<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <#include "../common/header.ftl"/>

</head>
<body>
<script>
    $(function () {
        $("#inputBtn").click(function () {
            console.log("1");
            $("#editForm").clearForm(true)
            $("#insertModel").modal('show')
        })

        $(".saveBtn").click(function () {
            $("#editForm").ajaxSubmit(function (data) {
                if (data.success) {
                    window.location.reload()
                }
            })
        })



    })
</script>

<div class="container " style="margin-top: 20px">
    <#include "../common/top.ftl"/>
    <div class="row">
        <div class="col-sm-3">
        <#--设置当前要回显当前菜单,必须在载人菜单前完成设置-->
            <#assign menu="sysMsg"/>
            <#include "../common/menu.ftl"/>
        </div>
        <div class="col-sm-9">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">系统消息</h1>
                </div>
            </div>
            <form class="form-inline" id="searchForm" action="" method="post">
                <input type="hidden" id="currentPage" name="currentPage" value="1">
            </form>
            <button id="inputBtn" type="button" class="btn btn-success">
                <span class="glyphicon glyphicon-plus"></span> 发布系统消息
            </button>
            <table class="table table-striped table-hover">
                <thead>
                <tr>
                    <th>标题</th>
                    <th>创建时间</th>
                    <th>内容</th>
                    <th></th>
                </tr>
                </thead>
                <tbody>
                <#list pageInfo.list as entity>
                    <tr>
                        <td>${(entity.title)!}</td>
                        <td>${(entity.creatTime?string("yyyy-MM-dd"))!}</td>
                        <td>${(entity.content)!}</td>
                    </tr>
                </#list>

                </tbody>
            </table>
           <#include "../common/page.ftl"/>
        </div>
    </div>
</div>

<div>
    <div class="modal fade" id="insertModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        添加系统消息
                    </h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" action="/messages/saveSysMsg.do" method="post" id="editForm">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">添加标题：</label>
                            <div class="col-sm-6">
                                <input type="text"  class="form-control" name="title"  />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">添加内容：</label>
                            <div class="col-sm-6">
                                <input type="text"  class="form-control" name="content"/>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="button" class="btn btn-primary saveBtn">
                        <span class="glyphicon glyphicon-saved"></span> 发布
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
</html>